package com.eastfair.point.entity;

import com.eastfair.mongocrud.component.ReplenishInfo;
import com.eastfair.mongocrud.model.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * Document定义集合
 * Indexed： 定义单索引
 *CompoundIndexes:定义组合索引
 *Field:定义mongo列
 *
 */
@Getter
@Setter
@Document(collection="test_collection")
@ReplenishInfo(isReplenish=true)//是否需要加填充符
public class TestCollection extends BaseEntity implements Serializable {
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("id")
    @Id
    @ApiModelProperty(required = true)
    private String id;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("statisticsDayId")
    @ApiModelProperty(value = "statisticsDayId")
    private String statisticsDayId;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("userId")
    @ApiModelProperty(value = "用户id")
    private String userId;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("userName")
    @ApiModelProperty(value = "用户名称")
    private String userName;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("fullName")
    @ApiModelProperty(value = "真实姓名")
    private String fullName;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("gender")
    @ApiModelProperty(value = "性别：0：女，1：男")
    private Integer gender;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("bookId")
    @ApiModelProperty(value = "书id")
    private String bookId;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("bookName")
    @ApiModelProperty(value = "书名称")
    private String bookName;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("bookType")
    @ApiModelProperty(value = "书籍类型：1书城，0其他")
    private String bookType;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("bookClassification")
    @ApiModelProperty(value = "书分类")
    private String bookClassification;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("num")
    @ApiModelProperty(value = "字数")
    private Long num;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "时长:单位秒")
    @Field("times")
    private Long times;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("date")
    @ApiModelProperty(value = "时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "阅读进度")
    @Field("pageNum")
    private String pageNum;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("deviceNum")
    @ApiModelProperty(value = "eink设备号")
    private String deviceNum;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("readWords")
    @ApiModelProperty(value = "读书总字数")
    private Long readWords;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("totalWords")
    @ApiModelProperty(value = "用户读书总字数")
    private Long totalWords;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("period")
    @ApiModelProperty(value = "学级")
    private String period;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("countyId")
    @ApiModelProperty(value = "区域id")
    private String countyId;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @ApiModelProperty(value = "区域名称")
    @Field("countyName")
    private String countyName;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("schoolId")
    @ApiModelProperty(value = "学校id")
    private String schoolId;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("schoolName")
    @ApiModelProperty(value = "学校名称")
    private String schoolName;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("gradeId")
    @ApiModelProperty(value = "年级id")
    private String gradeId;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("gradeName")
    @ApiModelProperty(value = "年级名称")
    private String gradeName;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("classId")
    @ApiModelProperty(value = "班级id")
    private String classId;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("className")
    @ApiModelProperty(value = "班级名称")
    private String className;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("createTime")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("updateTime")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("beginTime")
    @ApiModelProperty(value = "开始阅读时间")
    private Date beginTime;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("yearMonth")
    @ApiModelProperty(value = "月份")
    private String yearMonth;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("year")
    @ApiModelProperty(value = "学段")
    private String year;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @Field("roleName")
    @ApiModelProperty(value = "角色，多个以逗号分隔")
    private String roleName;
    @Field("einkMac")
    @ApiModelProperty(value = "eink版本")
    private String einkMac;
}
